package com.scala.oop.triat

/**
 * Created by Administrator on 2018/1/28/028.
 */
trait HelloTrait {
  def sayHello(name:String)
}
trait MakeFriedTrait{
  def makeFriendTo(b:Boy)
}


class Boy(val name:String) extends HelloTrait with  MakeFriedTrait{

  def sayHello(othername:String) =  println("Hello,"+othername+"I'm "+ name)

  def makeFriendTo(boy: Boy): Unit ={
    println("Hello "+ name +",I'm "+ boy.name + ",I want to make friend with you")
  }
}

 object  Boy{
   def main(args: Array[String]) {
     val b1 = new Boy("leo")
     val b = new Boy("xiaoming")
     b.makeFriendTo(b1)
   }
 }